var express = require('express');
var router = express.Router();
var fileUtils = require('../utils/Files');


/* delete a user by id */
router.delete('/user/:id', function(req, res) {
  var id = req.params.id;
  res.send({status:1,error:''});
});


/* get a user by id */
router.get('/user/:id', function(req, res) {
  var id = req.params.id;
  res.send({
    uid: id,
    name: 'Tom'
  });
});

/* get all of users */
router.get('/user', function(req, res) {
  res.send([
    { uid: 1, name: 'Tom'},
    { uid: 2, name: 'Jerry'}
    ]);
});

/* get all of users */
router.get('/file', function(req, res) {
  fileUtils.requestFileQ('http://host/a.html')
  .then(function (data){
    res.send(data);
  });
});


module.exports = router;
